\(\int \sec (e+f x) (a+a \sec (e+f x))^3 (c+d \sec (e+f x))^3 \, dx\) [202]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 31, antiderivative size = 288 \[ \int \sec (e+f x) (a+a \sec (e+f x))^3 (c+d \sec (e+f x))^3 \, dx=\frac {a^3 \left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \text {arctanh}(\sin (e+f x))}{16 f}+\frac {a^3 \left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \tan (e+f x)}{16 f}+\frac {\left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{48 f}+\frac {a (3 c+8 d) (a+a \sec (e+f x))^2 (c+d \sec (e+f x))^2 \tan (e+f x)}{30 f}+\frac {a (a+a \sec (e+f x))^2 (c+d \sec (e+f x))^3 \tan (e+f x)}{6 f}+\frac {a (a+a \sec (e+f x))^2 \left (2 \left (4 c^3+74 c^2 d+66 c d^2+21 d^3\right )+d \left (6 c^2+62 c d+31 d^2\right ) \sec (e+f x)\right ) \tan (e+f x)}{120 f} \]

[Out]

1/16*a^3*(40*c^3+90*c^2*d+78*c*d^2+23*d^3)*arctanh(sin(f*x+e))/f+1/16*a^3*(40*c^3+90*c^2*d+78*c*d^2+23*d^3)*ta
n(f*x+e)/f+1/48*(40*c^3+90*c^2*d+78*c*d^2+23*d^3)*(a^3+a^3*sec(f*x+e))*tan(f*x+e)/f+1/30*a*(3*c+8*d)*(a+a*sec(
f*x+e))^2*(c+d*sec(f*x+e))^2*tan(f*x+e)/f+1/6*a*(a+a*sec(f*x+e))^2*(c+d*sec(f*x+e))^3*tan(f*x+e)/f+1/120*a*(a+
a*sec(f*x+e))^2*(8*c^3+148*c^2*d+132*c*d^2+42*d^3+d*(6*c^2+62*c*d+31*d^2)*sec(f*x+e))*tan(f*x+e)/f

Rubi [A] (verified)

Time = 0.55 (sec) , antiderivative size = 333, normalized size of antiderivative = 1.16, number of steps used = 9, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.226, Rules used = {4072, 102, 152, 52, 65, 223, 209} \[ \int \sec (e+f x) (a+a \sec (e+f x))^3 (c+d \sec (e+f x))^3 \, dx=\frac {a^4 \left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \tan (e+f x) \arctan \left (\frac {\sqrt {a-a \sec (e+f x)}}{\sqrt {a (\sec (e+f x)+1)}}\right )}{8 f \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}+\frac {a^3 \left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \tan (e+f x)}{16 f}+\frac {\left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \tan (e+f x) \left (a^3 \sec (e+f x)+a^3\right )}{48 f}+\frac {d \tan (e+f x) (a \sec (e+f x)+a)^3 \left (70 c^2+4 d (8 c+3 d) \sec (e+f x)+54 c d+19 d^2\right )}{120 f}+\frac {a \left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \tan (e+f x) (a \sec (e+f x)+a)^2}{120 f}+\frac {d \tan (e+f x) (a \sec (e+f x)+a)^3 (c+d \sec (e+f x))^2}{6 f} \]

[In]

Int[Sec[e + f*x]*(a + a*Sec[e + f*x])^3*(c + d*Sec[e + f*x])^3,x]

[Out]

(a^3*(40*c^3 + 90*c^2*d + 78*c*d^2 + 23*d^3)*Tan[e + f*x])/(16*f) + (a^4*(40*c^3 + 90*c^2*d + 78*c*d^2 + 23*d^
3)*ArcTan[Sqrt[a - a*Sec[e + f*x]]/Sqrt[a*(1 + Sec[e + f*x])]]*Tan[e + f*x])/(8*f*Sqrt[a - a*Sec[e + f*x]]*Sqr
t[a + a*Sec[e + f*x]]) + (a*(40*c^3 + 90*c^2*d + 78*c*d^2 + 23*d^3)*(a + a*Sec[e + f*x])^2*Tan[e + f*x])/(120*
f) + ((40*c^3 + 90*c^2*d + 78*c*d^2 + 23*d^3)*(a^3 + a^3*Sec[e + f*x])*Tan[e + f*x])/(48*f) + (d*(a + a*Sec[e
+ f*x])^3*(c + d*Sec[e + f*x])^2*Tan[e + f*x])/(6*f) + (d*(a + a*Sec[e + f*x])^3*(70*c^2 + 54*c*d + 19*d^2 + 4
*d*(8*c + 3*d)*Sec[e + f*x])*Tan[e + f*x])/(120*f)

Rule 52

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(a + b*x)^(m + 1)*((c + d*x)^n/(b*(
m + n + 1))), x] + Dist[n*((b*c - a*d)/(b*(m + n + 1))), Int[(a + b*x)^m*(c + d*x)^(n - 1), x], x] /; FreeQ[{a
, b, c, d}, x] && NeQ[b*c - a*d, 0] && GtQ[n, 0] && NeQ[m + n + 1, 0] &&  !(IGtQ[m, 0] && ( !IntegerQ[n] || (G
tQ[m, 0] && LtQ[m - n, 0]))) &&  !ILtQ[m + n + 2, 0] && IntLinearQ[a, b, c, d, m, n, x]

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 102

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[b*(a +
b*x)^(m - 1)*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(d*f*(m + n + p + 1))), x] + Dist[1/(d*f*(m + n + p + 1)), I
nt[(a + b*x)^(m - 2)*(c + d*x)^n*(e + f*x)^p*Simp[a^2*d*f*(m + n + p + 1) - b*(b*c*e*(m - 1) + a*(d*e*(n + 1)
+ c*f*(p + 1))) + b*(a*d*f*(2*m + n + p) - b*(d*e*(m + n) + c*f*(m + p)))*x, x], x], x] /; FreeQ[{a, b, c, d,
e, f, n, p}, x] && GtQ[m, 1] && NeQ[m + n + p + 1, 0] && IntegerQ[m]

Rule 152

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_) + (f_.)*(x_))*((g_.) + (h_.)*(x_)), x_Symbol]
:> Simp[(-(a*d*f*h*(n + 2) + b*c*f*h*(m + 2) - b*d*(f*g + e*h)*(m + n + 3) - b*d*f*h*(m + n + 2)*x))*(a + b*x)
^(m + 1)*((c + d*x)^(n + 1)/(b^2*d^2*(m + n + 2)*(m + n + 3))), x] + Dist[(a^2*d^2*f*h*(n + 1)*(n + 2) + a*b*d
*(n + 1)*(2*c*f*h*(m + 1) - d*(f*g + e*h)*(m + n + 3)) + b^2*(c^2*f*h*(m + 1)*(m + 2) - c*d*(f*g + e*h)*(m + 1
)*(m + n + 3) + d^2*e*g*(m + n + 2)*(m + n + 3)))/(b^2*d^2*(m + n + 2)*(m + n + 3)), Int[(a + b*x)^m*(c + d*x)
^n, x], x] /; FreeQ[{a, b, c, d, e, f, g, h, m, n}, x] && NeQ[m + n + 2, 0] && NeQ[m + n + 3, 0]

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 223

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 4072

Int[(csc[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]
*(d_.) + (c_))^(n_), x_Symbol] :> Dist[a^2*g*(Cot[e + f*x]/(f*Sqrt[a + b*Csc[e + f*x]]*Sqrt[a - b*Csc[e + f*x]
])), Subst[Int[(g*x)^(p - 1)*(a + b*x)^(m - 1/2)*((c + d*x)^n/Sqrt[a - b*x]), x], x, Csc[e + f*x]], x] /; Free
Q[{a, b, c, d, e, f, g, m, n, p}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && (EqQ[p,
 1] || IntegerQ[m - 1/2])

Rubi steps \begin{align*} \text {integral}& = -\frac {\left (a^2 \tan (e+f x)\right ) \text {Subst}\left (\int \frac {(a+a x)^{5/2} (c+d x)^3}{\sqrt {a-a x}} \, dx,x,\sec (e+f x)\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = \frac {d (a+a \sec (e+f x))^3 (c+d \sec (e+f x))^2 \tan (e+f x)}{6 f}+\frac {\tan (e+f x) \text {Subst}\left (\int \frac {(a+a x)^{5/2} (c+d x) \left (-a^2 \left (6 c^2+3 c d+2 d^2\right )-a^2 d (8 c+3 d) x\right )}{\sqrt {a-a x}} \, dx,x,\sec (e+f x)\right )}{6 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = \frac {d (a+a \sec (e+f x))^3 (c+d \sec (e+f x))^2 \tan (e+f x)}{6 f}+\frac {d (a+a \sec (e+f x))^3 \left (70 c^2+54 c d+19 d^2+4 d (8 c+3 d) \sec (e+f x)\right ) \tan (e+f x)}{120 f}-\frac {\left (a^2 \left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \tan (e+f x)\right ) \text {Subst}\left (\int \frac {(a+a x)^{5/2}}{\sqrt {a-a x}} \, dx,x,\sec (e+f x)\right )}{40 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = \frac {a \left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) (a+a \sec (e+f x))^2 \tan (e+f x)}{120 f}+\frac {d (a+a \sec (e+f x))^3 (c+d \sec (e+f x))^2 \tan (e+f x)}{6 f}+\frac {d (a+a \sec (e+f x))^3 \left (70 c^2+54 c d+19 d^2+4 d (8 c+3 d) \sec (e+f x)\right ) \tan (e+f x)}{120 f}-\frac {\left (a^3 \left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \tan (e+f x)\right ) \text {Subst}\left (\int \frac {(a+a x)^{3/2}}{\sqrt {a-a x}} \, dx,x,\sec (e+f x)\right )}{24 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = \frac {a \left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) (a+a \sec (e+f x))^2 \tan (e+f x)}{120 f}+\frac {\left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{48 f}+\frac {d (a+a \sec (e+f x))^3 (c+d \sec (e+f x))^2 \tan (e+f x)}{6 f}+\frac {d (a+a \sec (e+f x))^3 \left (70 c^2+54 c d+19 d^2+4 d (8 c+3 d) \sec (e+f x)\right ) \tan (e+f x)}{120 f}-\frac {\left (a^4 \left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \tan (e+f x)\right ) \text {Subst}\left (\int \frac {\sqrt {a+a x}}{\sqrt {a-a x}} \, dx,x,\sec (e+f x)\right )}{16 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = \frac {a^3 \left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \tan (e+f x)}{16 f}+\frac {a \left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) (a+a \sec (e+f x))^2 \tan (e+f x)}{120 f}+\frac {\left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{48 f}+\frac {d (a+a \sec (e+f x))^3 (c+d \sec (e+f x))^2 \tan (e+f x)}{6 f}+\frac {d (a+a \sec (e+f x))^3 \left (70 c^2+54 c d+19 d^2+4 d (8 c+3 d) \sec (e+f x)\right ) \tan (e+f x)}{120 f}-\frac {\left (a^5 \left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \tan (e+f x)\right ) \text {Subst}\left (\int \frac {1}{\sqrt {a-a x} \sqrt {a+a x}} \, dx,x,\sec (e+f x)\right )}{16 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = \frac {a^3 \left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \tan (e+f x)}{16 f}+\frac {a \left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) (a+a \sec (e+f x))^2 \tan (e+f x)}{120 f}+\frac {\left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{48 f}+\frac {d (a+a \sec (e+f x))^3 (c+d \sec (e+f x))^2 \tan (e+f x)}{6 f}+\frac {d (a+a \sec (e+f x))^3 \left (70 c^2+54 c d+19 d^2+4 d (8 c+3 d) \sec (e+f x)\right ) \tan (e+f x)}{120 f}+\frac {\left (a^4 \left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \tan (e+f x)\right ) \text {Subst}\left (\int \frac {1}{\sqrt {2 a-x^2}} \, dx,x,\sqrt {a-a \sec (e+f x)}\right )}{8 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = \frac {a^3 \left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \tan (e+f x)}{16 f}+\frac {a \left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) (a+a \sec (e+f x))^2 \tan (e+f x)}{120 f}+\frac {\left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{48 f}+\frac {d (a+a \sec (e+f x))^3 (c+d \sec (e+f x))^2 \tan (e+f x)}{6 f}+\frac {d (a+a \sec (e+f x))^3 \left (70 c^2+54 c d+19 d^2+4 d (8 c+3 d) \sec (e+f x)\right ) \tan (e+f x)}{120 f}+\frac {\left (a^4 \left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \tan (e+f x)\right ) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\frac {\sqrt {a-a \sec (e+f x)}}{\sqrt {a+a \sec (e+f x)}}\right )}{8 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = \frac {a^3 \left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \tan (e+f x)}{16 f}+\frac {a^4 \left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \arctan \left (\frac {\sqrt {a-a \sec (e+f x)}}{\sqrt {a+a \sec (e+f x)}}\right ) \tan (e+f x)}{8 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}+\frac {a \left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) (a+a \sec (e+f x))^2 \tan (e+f x)}{120 f}+\frac {\left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{48 f}+\frac {d (a+a \sec (e+f x))^3 (c+d \sec (e+f x))^2 \tan (e+f x)}{6 f}+\frac {d (a+a \sec (e+f x))^3 \left (70 c^2+54 c d+19 d^2+4 d (8 c+3 d) \sec (e+f x)\right ) \tan (e+f x)}{120 f} \\ \end{align*}

Mathematica [A] (verified)

Time = 6.09 (sec) , antiderivative size = 170, normalized size of antiderivative = 0.59 \[ \int \sec (e+f x) (a+a \sec (e+f x))^3 (c+d \sec (e+f x))^3 \, dx=\frac {a^3 \left (15 \left (40 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \text {arctanh}(\sin (e+f x))+\tan (e+f x) \left (15 \left (24 c^3+90 c^2 d+78 c d^2+23 d^3\right ) \sec (e+f x)+10 d \left (18 c^2+54 c d+23 d^2\right ) \sec ^3(e+f x)+40 d^3 \sec ^5(e+f x)+16 (c+d) \left (60 (c+d)^2+5 \left (c^2+8 c d+7 d^2\right ) \tan ^2(e+f x)+9 d^2 \tan ^4(e+f x)\right )\right )\right )}{240 f} \]

[In]

Integrate[Sec[e + f*x]*(a + a*Sec[e + f*x])^3*(c + d*Sec[e + f*x])^3,x]

[Out]

(a^3*(15*(40*c^3 + 90*c^2*d + 78*c*d^2 + 23*d^3)*ArcTanh[Sin[e + f*x]] + Tan[e + f*x]*(15*(24*c^3 + 90*c^2*d +
 78*c*d^2 + 23*d^3)*Sec[e + f*x] + 10*d*(18*c^2 + 54*c*d + 23*d^2)*Sec[e + f*x]^3 + 40*d^3*Sec[e + f*x]^5 + 16
*(c + d)*(60*(c + d)^2 + 5*(c^2 + 8*c*d + 7*d^2)*Tan[e + f*x]^2 + 9*d^2*Tan[e + f*x]^4))))/(240*f)

Maple [A] (verified)

Time = 6.19 (sec) , antiderivative size = 355, normalized size of antiderivative = 1.23

method result size
norman \(\frac {-\frac {33 a^{3} \left (40 c^{3}+90 c^{2} d +78 c \,d^{2}+23 d^{3}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{7}}{20 f}+\frac {17 a^{3} \left (40 c^{3}+90 c^{2} d +78 c \,d^{2}+23 d^{3}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{9}}{24 f}-\frac {a^{3} \left (40 c^{3}+90 c^{2} d +78 c \,d^{2}+23 d^{3}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{11}}{8 f}+\frac {a^{3} \left (88 c^{3}+294 c^{2} d +306 c \,d^{2}+105 d^{3}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{8 f}+\frac {3 a^{3} \left (520 c^{3}+1250 c^{2} d +998 c \,d^{2}+323 d^{3}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{20 f}-\frac {a^{3} \left (1112 c^{3}+3078 c^{2} d +2514 c \,d^{2}+633 d^{3}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{24 f}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right )^{6}}-\frac {a^{3} \left (40 c^{3}+90 c^{2} d +78 c \,d^{2}+23 d^{3}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{16 f}+\frac {a^{3} \left (40 c^{3}+90 c^{2} d +78 c \,d^{2}+23 d^{3}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{16 f}\) \(355\)
parallelrisch \(\frac {6 \left (-\frac {25 \left (\frac {2 \cos \left (4 f x +4 e \right )}{5}+\frac {2}{3}+\cos \left (2 f x +2 e \right )+\frac {\cos \left (6 f x +6 e \right )}{15}\right ) \left (c^{3}+\frac {9}{4} c^{2} d +\frac {39}{20} c \,d^{2}+\frac {23}{40} d^{3}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{4}+\frac {25 \left (\frac {2 \cos \left (4 f x +4 e \right )}{5}+\frac {2}{3}+\cos \left (2 f x +2 e \right )+\frac {\cos \left (6 f x +6 e \right )}{15}\right ) \left (c^{3}+\frac {9}{4} c^{2} d +\frac {39}{20} c \,d^{2}+\frac {23}{40} d^{3}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{4}+\left (\frac {23}{2} c^{2} d +13 c \,d^{2}+\frac {7}{2} c^{3}+5 d^{3}\right ) \sin \left (2 f x +2 e \right )+\frac {\left (\frac {53}{4} c^{2} d +\frac {63}{4} c \,d^{2}+3 c^{3}+\frac {391}{72} d^{3}\right ) \sin \left (3 f x +3 e \right )}{2}+\frac {8 \left (c^{2}+2 c d +\frac {17}{20} d^{2}\right ) \left (c +d \right ) \sin \left (4 f x +4 e \right )}{3}+\frac {\left (\frac {13}{4} c \,d^{2}+\frac {15}{4} c^{2} d +c^{3}+\frac {23}{24} d^{3}\right ) \sin \left (5 f x +5 e \right )}{2}+\frac {11 \left (c^{2}+\frac {16}{11} c d +\frac {34}{55} d^{2}\right ) \left (c +d \right ) \sin \left (6 f x +6 e \right )}{18}+\sin \left (f x +e \right ) \left (\frac {19}{4} c^{2} d +\frac {25}{4} c \,d^{2}+\frac {25}{8} d^{3}+c^{3}\right )\right ) a^{3}}{f \left (6 \cos \left (4 f x +4 e \right )+10+15 \cos \left (2 f x +2 e \right )+\cos \left (6 f x +6 e \right )\right )}\) \(362\)
parts \(-\frac {\left (3 a^{3} c \,d^{2}+3 a^{3} d^{3}\right ) \left (-\frac {8}{15}-\frac {\sec \left (f x +e \right )^{4}}{5}-\frac {4 \sec \left (f x +e \right )^{2}}{15}\right ) \tan \left (f x +e \right )}{f}+\frac {\left (3 c^{3} a^{3}+3 a^{3} c^{2} d \right ) \tan \left (f x +e \right )}{f}+\frac {\left (3 a^{3} c^{2} d +9 a^{3} c \,d^{2}+3 a^{3} d^{3}\right ) \left (-\left (-\frac {\sec \left (f x +e \right )^{3}}{4}-\frac {3 \sec \left (f x +e \right )}{8}\right ) \tan \left (f x +e \right )+\frac {3 \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{8}\right )}{f}+\frac {\left (3 c^{3} a^{3}+9 a^{3} c^{2} d +3 a^{3} c \,d^{2}\right ) \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )}{f}-\frac {\left (c^{3} a^{3}+9 a^{3} c^{2} d +9 a^{3} c \,d^{2}+a^{3} d^{3}\right ) \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )}{f}+\frac {a^{3} d^{3} \left (-\left (-\frac {\sec \left (f x +e \right )^{5}}{6}-\frac {5 \sec \left (f x +e \right )^{3}}{24}-\frac {5 \sec \left (f x +e \right )}{16}\right ) \tan \left (f x +e \right )+\frac {5 \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{16}\right )}{f}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right ) a^{3} c^{3}}{f}\) \(362\)
derivativedivides \(\frac {-c^{3} a^{3} \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )+3 a^{3} c^{2} d \left (-\left (-\frac {\sec \left (f x +e \right )^{3}}{4}-\frac {3 \sec \left (f x +e \right )}{8}\right ) \tan \left (f x +e \right )+\frac {3 \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{8}\right )-3 a^{3} c \,d^{2} \left (-\frac {8}{15}-\frac {\sec \left (f x +e \right )^{4}}{5}-\frac {4 \sec \left (f x +e \right )^{2}}{15}\right ) \tan \left (f x +e \right )+a^{3} d^{3} \left (-\left (-\frac {\sec \left (f x +e \right )^{5}}{6}-\frac {5 \sec \left (f x +e \right )^{3}}{24}-\frac {5 \sec \left (f x +e \right )}{16}\right ) \tan \left (f x +e \right )+\frac {5 \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{16}\right )+3 c^{3} a^{3} \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )-9 a^{3} c^{2} d \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )+9 a^{3} c \,d^{2} \left (-\left (-\frac {\sec \left (f x +e \right )^{3}}{4}-\frac {3 \sec \left (f x +e \right )}{8}\right ) \tan \left (f x +e \right )+\frac {3 \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{8}\right )-3 a^{3} d^{3} \left (-\frac {8}{15}-\frac {\sec \left (f x +e \right )^{4}}{5}-\frac {4 \sec \left (f x +e \right )^{2}}{15}\right ) \tan \left (f x +e \right )+3 c^{3} a^{3} \tan \left (f x +e \right )+9 a^{3} c^{2} d \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )-9 a^{3} c \,d^{2} \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )+3 a^{3} d^{3} \left (-\left (-\frac {\sec \left (f x +e \right )^{3}}{4}-\frac {3 \sec \left (f x +e \right )}{8}\right ) \tan \left (f x +e \right )+\frac {3 \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{8}\right )+c^{3} a^{3} \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )+3 a^{3} c^{2} d \tan \left (f x +e \right )+3 a^{3} c \,d^{2} \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )-a^{3} d^{3} \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )}{f}\) \(573\)
default \(\frac {-c^{3} a^{3} \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )+3 a^{3} c^{2} d \left (-\left (-\frac {\sec \left (f x +e \right )^{3}}{4}-\frac {3 \sec \left (f x +e \right )}{8}\right ) \tan \left (f x +e \right )+\frac {3 \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{8}\right )-3 a^{3} c \,d^{2} \left (-\frac {8}{15}-\frac {\sec \left (f x +e \right )^{4}}{5}-\frac {4 \sec \left (f x +e \right )^{2}}{15}\right ) \tan \left (f x +e \right )+a^{3} d^{3} \left (-\left (-\frac {\sec \left (f x +e \right )^{5}}{6}-\frac {5 \sec \left (f x +e \right )^{3}}{24}-\frac {5 \sec \left (f x +e \right )}{16}\right ) \tan \left (f x +e \right )+\frac {5 \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{16}\right )+3 c^{3} a^{3} \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )-9 a^{3} c^{2} d \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )+9 a^{3} c \,d^{2} \left (-\left (-\frac {\sec \left (f x +e \right )^{3}}{4}-\frac {3 \sec \left (f x +e \right )}{8}\right ) \tan \left (f x +e \right )+\frac {3 \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{8}\right )-3 a^{3} d^{3} \left (-\frac {8}{15}-\frac {\sec \left (f x +e \right )^{4}}{5}-\frac {4 \sec \left (f x +e \right )^{2}}{15}\right ) \tan \left (f x +e \right )+3 c^{3} a^{3} \tan \left (f x +e \right )+9 a^{3} c^{2} d \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )-9 a^{3} c \,d^{2} \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )+3 a^{3} d^{3} \left (-\left (-\frac {\sec \left (f x +e \right )^{3}}{4}-\frac {3 \sec \left (f x +e \right )}{8}\right ) \tan \left (f x +e \right )+\frac {3 \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{8}\right )+c^{3} a^{3} \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )+3 a^{3} c^{2} d \tan \left (f x +e \right )+3 a^{3} c \,d^{2} \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )-a^{3} d^{3} \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )}{f}\) \(573\)
risch \(-\frac {i a^{3} \left (-880 c^{3}-1824 c \,d^{2}-544 d^{3}-2160 c^{2} d -1170 c \,d^{2} {\mathrm e}^{i \left (f x +e \right )}-10944 c \,d^{2} {\mathrm e}^{2 i \left (f x +e \right )}-5670 c \,d^{2} {\mathrm e}^{3 i \left (f x +e \right )}-18240 c \,d^{2} {\mathrm e}^{6 i \left (f x +e \right )}-1350 c^{2} d \,{\mathrm e}^{i \left (f x +e \right )}+4500 c \,d^{2} {\mathrm e}^{7 i \left (f x +e \right )}-12240 c^{2} d \,{\mathrm e}^{2 i \left (f x +e \right )}+3420 c^{2} d \,{\mathrm e}^{7 i \left (f x +e \right )}-7920 c^{2} d \,{\mathrm e}^{8 i \left (f x +e \right )}-23040 c \,d^{2} {\mathrm e}^{4 i \left (f x +e \right )}-4770 c^{2} d \,{\mathrm e}^{3 i \left (f x +e \right )}+5670 c \,d^{2} {\mathrm e}^{9 i \left (f x +e \right )}-4500 c \,d^{2} {\mathrm e}^{5 i \left (f x +e \right )}+1170 c \,d^{2} {\mathrm e}^{11 i \left (f x +e \right )}-720 c^{2} d \,{\mathrm e}^{10 i \left (f x +e \right )}-3420 c^{2} d \,{\mathrm e}^{5 i \left (f x +e \right )}-4320 c \,d^{2} {\mathrm e}^{8 i \left (f x +e \right )}-21600 c^{2} d \,{\mathrm e}^{6 i \left (f x +e \right )}-24480 c^{2} d \,{\mathrm e}^{4 i \left (f x +e \right )}+1350 c^{2} d \,{\mathrm e}^{11 i \left (f x +e \right )}+4770 c^{2} d \,{\mathrm e}^{9 i \left (f x +e \right )}-345 d^{3} {\mathrm e}^{i \left (f x +e \right )}+1955 d^{3} {\mathrm e}^{9 i \left (f x +e \right )}-2250 d^{3} {\mathrm e}^{5 i \left (f x +e \right )}-8800 c^{3} {\mathrm e}^{6 i \left (f x +e \right )}-1955 d^{3} {\mathrm e}^{3 i \left (f x +e \right )}-5440 d^{3} {\mathrm e}^{6 i \left (f x +e \right )}+1080 c^{3} {\mathrm e}^{9 i \left (f x +e \right )}+720 c^{3} {\mathrm e}^{7 i \left (f x +e \right )}-480 d^{3} {\mathrm e}^{8 i \left (f x +e \right )}-720 c^{3} {\mathrm e}^{10 i \left (f x +e \right )}+345 d^{3} {\mathrm e}^{11 i \left (f x +e \right )}+360 c^{3} {\mathrm e}^{11 i \left (f x +e \right )}-720 c^{3} {\mathrm e}^{5 i \left (f x +e \right )}-3264 d^{3} {\mathrm e}^{2 i \left (f x +e \right )}-360 c^{3} {\mathrm e}^{i \left (f x +e \right )}+2250 d^{3} {\mathrm e}^{7 i \left (f x +e \right )}-7680 d^{3} {\mathrm e}^{4 i \left (f x +e \right )}-4560 c^{3} {\mathrm e}^{2 i \left (f x +e \right )}-1080 c^{3} {\mathrm e}^{3 i \left (f x +e \right )}-4080 c^{3} {\mathrm e}^{8 i \left (f x +e \right )}-9120 c^{3} {\mathrm e}^{4 i \left (f x +e \right )}\right )}{120 f \left (1+{\mathrm e}^{2 i \left (f x +e \right )}\right )^{6}}+\frac {5 c^{3} a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}{2 f}+\frac {45 a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right ) c^{2} d}{8 f}+\frac {39 a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right ) c \,d^{2}}{8 f}+\frac {23 a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right ) d^{3}}{16 f}-\frac {5 c^{3} a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}{2 f}-\frac {45 a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right ) c^{2} d}{8 f}-\frac {39 a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right ) c \,d^{2}}{8 f}-\frac {23 a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right ) d^{3}}{16 f}\) \(852\)

[In]

int(sec(f*x+e)*(a+a*sec(f*x+e))^3*(c+d*sec(f*x+e))^3,x,method=_RETURNVERBOSE)

[Out]

(-33/20*a^3*(40*c^3+90*c^2*d+78*c*d^2+23*d^3)/f*tan(1/2*f*x+1/2*e)^7+17/24*a^3*(40*c^3+90*c^2*d+78*c*d^2+23*d^
3)/f*tan(1/2*f*x+1/2*e)^9-1/8*a^3*(40*c^3+90*c^2*d+78*c*d^2+23*d^3)/f*tan(1/2*f*x+1/2*e)^11+1/8*a^3*(88*c^3+29
4*c^2*d+306*c*d^2+105*d^3)/f*tan(1/2*f*x+1/2*e)+3/20*a^3*(520*c^3+1250*c^2*d+998*c*d^2+323*d^3)/f*tan(1/2*f*x+
1/2*e)^5-1/24*a^3*(1112*c^3+3078*c^2*d+2514*c*d^2+633*d^3)/f*tan(1/2*f*x+1/2*e)^3)/(tan(1/2*f*x+1/2*e)^2-1)^6-
1/16*a^3*(40*c^3+90*c^2*d+78*c*d^2+23*d^3)/f*ln(tan(1/2*f*x+1/2*e)-1)+1/16*a^3*(40*c^3+90*c^2*d+78*c*d^2+23*d^
3)/f*ln(tan(1/2*f*x+1/2*e)+1)

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 337, normalized size of antiderivative = 1.17 \[ \int \sec (e+f x) (a+a \sec (e+f x))^3 (c+d \sec (e+f x))^3 \, dx=\frac {15 \, {\left (40 \, a^{3} c^{3} + 90 \, a^{3} c^{2} d + 78 \, a^{3} c d^{2} + 23 \, a^{3} d^{3}\right )} \cos \left (f x + e\right )^{6} \log \left (\sin \left (f x + e\right ) + 1\right ) - 15 \, {\left (40 \, a^{3} c^{3} + 90 \, a^{3} c^{2} d + 78 \, a^{3} c d^{2} + 23 \, a^{3} d^{3}\right )} \cos \left (f x + e\right )^{6} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, {\left (40 \, a^{3} d^{3} + 16 \, {\left (55 \, a^{3} c^{3} + 135 \, a^{3} c^{2} d + 114 \, a^{3} c d^{2} + 34 \, a^{3} d^{3}\right )} \cos \left (f x + e\right )^{5} + 15 \, {\left (24 \, a^{3} c^{3} + 90 \, a^{3} c^{2} d + 78 \, a^{3} c d^{2} + 23 \, a^{3} d^{3}\right )} \cos \left (f x + e\right )^{4} + 16 \, {\left (5 \, a^{3} c^{3} + 45 \, a^{3} c^{2} d + 57 \, a^{3} c d^{2} + 17 \, a^{3} d^{3}\right )} \cos \left (f x + e\right )^{3} + 10 \, {\left (18 \, a^{3} c^{2} d + 54 \, a^{3} c d^{2} + 23 \, a^{3} d^{3}\right )} \cos \left (f x + e\right )^{2} + 144 \, {\left (a^{3} c d^{2} + a^{3} d^{3}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{480 \, f \cos \left (f x + e\right )^{6}} \]

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))^3*(c+d*sec(f*x+e))^3,x, algorithm="fricas")

[Out]

1/480*(15*(40*a^3*c^3 + 90*a^3*c^2*d + 78*a^3*c*d^2 + 23*a^3*d^3)*cos(f*x + e)^6*log(sin(f*x + e) + 1) - 15*(4
0*a^3*c^3 + 90*a^3*c^2*d + 78*a^3*c*d^2 + 23*a^3*d^3)*cos(f*x + e)^6*log(-sin(f*x + e) + 1) + 2*(40*a^3*d^3 +
16*(55*a^3*c^3 + 135*a^3*c^2*d + 114*a^3*c*d^2 + 34*a^3*d^3)*cos(f*x + e)^5 + 15*(24*a^3*c^3 + 90*a^3*c^2*d +
78*a^3*c*d^2 + 23*a^3*d^3)*cos(f*x + e)^4 + 16*(5*a^3*c^3 + 45*a^3*c^2*d + 57*a^3*c*d^2 + 17*a^3*d^3)*cos(f*x
+ e)^3 + 10*(18*a^3*c^2*d + 54*a^3*c*d^2 + 23*a^3*d^3)*cos(f*x + e)^2 + 144*(a^3*c*d^2 + a^3*d^3)*cos(f*x + e)
)*sin(f*x + e))/(f*cos(f*x + e)^6)

Sympy [F]

\[ \int \sec (e+f x) (a+a \sec (e+f x))^3 (c+d \sec (e+f x))^3 \, dx=a^{3} \left (\int c^{3} \sec {\left (e + f x \right )}\, dx + \int 3 c^{3} \sec ^{2}{\left (e + f x \right )}\, dx + \int 3 c^{3} \sec ^{3}{\left (e + f x \right )}\, dx + \int c^{3} \sec ^{4}{\left (e + f x \right )}\, dx + \int d^{3} \sec ^{4}{\left (e + f x \right )}\, dx + \int 3 d^{3} \sec ^{5}{\left (e + f x \right )}\, dx + \int 3 d^{3} \sec ^{6}{\left (e + f x \right )}\, dx + \int d^{3} \sec ^{7}{\left (e + f x \right )}\, dx + \int 3 c d^{2} \sec ^{3}{\left (e + f x \right )}\, dx + \int 9 c d^{2} \sec ^{4}{\left (e + f x \right )}\, dx + \int 9 c d^{2} \sec ^{5}{\left (e + f x \right )}\, dx + \int 3 c d^{2} \sec ^{6}{\left (e + f x \right )}\, dx + \int 3 c^{2} d \sec ^{2}{\left (e + f x \right )}\, dx + \int 9 c^{2} d \sec ^{3}{\left (e + f x \right )}\, dx + \int 9 c^{2} d \sec ^{4}{\left (e + f x \right )}\, dx + \int 3 c^{2} d \sec ^{5}{\left (e + f x \right )}\, dx\right ) \]

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))**3*(c+d*sec(f*x+e))**3,x)

[Out]

a**3*(Integral(c**3*sec(e + f*x), x) + Integral(3*c**3*sec(e + f*x)**2, x) + Integral(3*c**3*sec(e + f*x)**3,
x) + Integral(c**3*sec(e + f*x)**4, x) + Integral(d**3*sec(e + f*x)**4, x) + Integral(3*d**3*sec(e + f*x)**5,
x) + Integral(3*d**3*sec(e + f*x)**6, x) + Integral(d**3*sec(e + f*x)**7, x) + Integral(3*c*d**2*sec(e + f*x)*
*3, x) + Integral(9*c*d**2*sec(e + f*x)**4, x) + Integral(9*c*d**2*sec(e + f*x)**5, x) + Integral(3*c*d**2*sec
(e + f*x)**6, x) + Integral(3*c**2*d*sec(e + f*x)**2, x) + Integral(9*c**2*d*sec(e + f*x)**3, x) + Integral(9*
c**2*d*sec(e + f*x)**4, x) + Integral(3*c**2*d*sec(e + f*x)**5, x))

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 701 vs. \(2 (273) = 546\).

Time = 0.24 (sec) , antiderivative size = 701, normalized size of antiderivative = 2.43 \[ \int \sec (e+f x) (a+a \sec (e+f x))^3 (c+d \sec (e+f x))^3 \, dx=\frac {160 \, {\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} a^{3} c^{3} + 1440 \, {\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} a^{3} c^{2} d + 96 \, {\left (3 \, \tan \left (f x + e\right )^{5} + 10 \, \tan \left (f x + e\right )^{3} + 15 \, \tan \left (f x + e\right )\right )} a^{3} c d^{2} + 1440 \, {\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} a^{3} c d^{2} + 96 \, {\left (3 \, \tan \left (f x + e\right )^{5} + 10 \, \tan \left (f x + e\right )^{3} + 15 \, \tan \left (f x + e\right )\right )} a^{3} d^{3} + 160 \, {\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} a^{3} d^{3} - 5 \, a^{3} d^{3} {\left (\frac {2 \, {\left (15 \, \sin \left (f x + e\right )^{5} - 40 \, \sin \left (f x + e\right )^{3} + 33 \, \sin \left (f x + e\right )\right )}}{\sin \left (f x + e\right )^{6} - 3 \, \sin \left (f x + e\right )^{4} + 3 \, \sin \left (f x + e\right )^{2} - 1} - 15 \, \log \left (\sin \left (f x + e\right ) + 1\right ) + 15 \, \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 90 \, a^{3} c^{2} d {\left (\frac {2 \, {\left (3 \, \sin \left (f x + e\right )^{3} - 5 \, \sin \left (f x + e\right )\right )}}{\sin \left (f x + e\right )^{4} - 2 \, \sin \left (f x + e\right )^{2} + 1} - 3 \, \log \left (\sin \left (f x + e\right ) + 1\right ) + 3 \, \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 270 \, a^{3} c d^{2} {\left (\frac {2 \, {\left (3 \, \sin \left (f x + e\right )^{3} - 5 \, \sin \left (f x + e\right )\right )}}{\sin \left (f x + e\right )^{4} - 2 \, \sin \left (f x + e\right )^{2} + 1} - 3 \, \log \left (\sin \left (f x + e\right ) + 1\right ) + 3 \, \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 90 \, a^{3} d^{3} {\left (\frac {2 \, {\left (3 \, \sin \left (f x + e\right )^{3} - 5 \, \sin \left (f x + e\right )\right )}}{\sin \left (f x + e\right )^{4} - 2 \, \sin \left (f x + e\right )^{2} + 1} - 3 \, \log \left (\sin \left (f x + e\right ) + 1\right ) + 3 \, \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 360 \, a^{3} c^{3} {\left (\frac {2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 1080 \, a^{3} c^{2} d {\left (\frac {2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 360 \, a^{3} c d^{2} {\left (\frac {2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} + 480 \, a^{3} c^{3} \log \left (\sec \left (f x + e\right ) + \tan \left (f x + e\right )\right ) + 1440 \, a^{3} c^{3} \tan \left (f x + e\right ) + 1440 \, a^{3} c^{2} d \tan \left (f x + e\right )}{480 \, f} \]

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))^3*(c+d*sec(f*x+e))^3,x, algorithm="maxima")

[Out]

1/480*(160*(tan(f*x + e)^3 + 3*tan(f*x + e))*a^3*c^3 + 1440*(tan(f*x + e)^3 + 3*tan(f*x + e))*a^3*c^2*d + 96*(
3*tan(f*x + e)^5 + 10*tan(f*x + e)^3 + 15*tan(f*x + e))*a^3*c*d^2 + 1440*(tan(f*x + e)^3 + 3*tan(f*x + e))*a^3
*c*d^2 + 96*(3*tan(f*x + e)^5 + 10*tan(f*x + e)^3 + 15*tan(f*x + e))*a^3*d^3 + 160*(tan(f*x + e)^3 + 3*tan(f*x
 + e))*a^3*d^3 - 5*a^3*d^3*(2*(15*sin(f*x + e)^5 - 40*sin(f*x + e)^3 + 33*sin(f*x + e))/(sin(f*x + e)^6 - 3*si
n(f*x + e)^4 + 3*sin(f*x + e)^2 - 1) - 15*log(sin(f*x + e) + 1) + 15*log(sin(f*x + e) - 1)) - 90*a^3*c^2*d*(2*
(3*sin(f*x + e)^3 - 5*sin(f*x + e))/(sin(f*x + e)^4 - 2*sin(f*x + e)^2 + 1) - 3*log(sin(f*x + e) + 1) + 3*log(
sin(f*x + e) - 1)) - 270*a^3*c*d^2*(2*(3*sin(f*x + e)^3 - 5*sin(f*x + e))/(sin(f*x + e)^4 - 2*sin(f*x + e)^2 +
 1) - 3*log(sin(f*x + e) + 1) + 3*log(sin(f*x + e) - 1)) - 90*a^3*d^3*(2*(3*sin(f*x + e)^3 - 5*sin(f*x + e))/(
sin(f*x + e)^4 - 2*sin(f*x + e)^2 + 1) - 3*log(sin(f*x + e) + 1) + 3*log(sin(f*x + e) - 1)) - 360*a^3*c^3*(2*s
in(f*x + e)/(sin(f*x + e)^2 - 1) - log(sin(f*x + e) + 1) + log(sin(f*x + e) - 1)) - 1080*a^3*c^2*d*(2*sin(f*x
+ e)/(sin(f*x + e)^2 - 1) - log(sin(f*x + e) + 1) + log(sin(f*x + e) - 1)) - 360*a^3*c*d^2*(2*sin(f*x + e)/(si
n(f*x + e)^2 - 1) - log(sin(f*x + e) + 1) + log(sin(f*x + e) - 1)) + 480*a^3*c^3*log(sec(f*x + e) + tan(f*x +
e)) + 1440*a^3*c^3*tan(f*x + e) + 1440*a^3*c^2*d*tan(f*x + e))/f

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 584 vs. \(2 (273) = 546\).

Time = 0.44 (sec) , antiderivative size = 584, normalized size of antiderivative = 2.03 \[ \int \sec (e+f x) (a+a \sec (e+f x))^3 (c+d \sec (e+f x))^3 \, dx=\frac {15 \, {\left (40 \, a^{3} c^{3} + 90 \, a^{3} c^{2} d + 78 \, a^{3} c d^{2} + 23 \, a^{3} d^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1 \right |}\right ) - 15 \, {\left (40 \, a^{3} c^{3} + 90 \, a^{3} c^{2} d + 78 \, a^{3} c d^{2} + 23 \, a^{3} d^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1 \right |}\right ) - \frac {2 \, {\left (600 \, a^{3} c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{11} + 1350 \, a^{3} c^{2} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{11} + 1170 \, a^{3} c d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{11} + 345 \, a^{3} d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{11} - 3400 \, a^{3} c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{9} - 7650 \, a^{3} c^{2} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{9} - 6630 \, a^{3} c d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{9} - 1955 \, a^{3} d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{9} + 7920 \, a^{3} c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} + 17820 \, a^{3} c^{2} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} + 15444 \, a^{3} c d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} + 4554 \, a^{3} d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} - 9360 \, a^{3} c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 22500 \, a^{3} c^{2} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 17964 \, a^{3} c d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 5814 \, a^{3} d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 5560 \, a^{3} c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 15390 \, a^{3} c^{2} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 12570 \, a^{3} c d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 3165 \, a^{3} d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 1320 \, a^{3} c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 4410 \, a^{3} c^{2} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 4590 \, a^{3} c d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1575 \, a^{3} d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1\right )}^{6}}}{240 \, f} \]

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))^3*(c+d*sec(f*x+e))^3,x, algorithm="giac")

[Out]

1/240*(15*(40*a^3*c^3 + 90*a^3*c^2*d + 78*a^3*c*d^2 + 23*a^3*d^3)*log(abs(tan(1/2*f*x + 1/2*e) + 1)) - 15*(40*
a^3*c^3 + 90*a^3*c^2*d + 78*a^3*c*d^2 + 23*a^3*d^3)*log(abs(tan(1/2*f*x + 1/2*e) - 1)) - 2*(600*a^3*c^3*tan(1/
2*f*x + 1/2*e)^11 + 1350*a^3*c^2*d*tan(1/2*f*x + 1/2*e)^11 + 1170*a^3*c*d^2*tan(1/2*f*x + 1/2*e)^11 + 345*a^3*
d^3*tan(1/2*f*x + 1/2*e)^11 - 3400*a^3*c^3*tan(1/2*f*x + 1/2*e)^9 - 7650*a^3*c^2*d*tan(1/2*f*x + 1/2*e)^9 - 66
30*a^3*c*d^2*tan(1/2*f*x + 1/2*e)^9 - 1955*a^3*d^3*tan(1/2*f*x + 1/2*e)^9 + 7920*a^3*c^3*tan(1/2*f*x + 1/2*e)^
7 + 17820*a^3*c^2*d*tan(1/2*f*x + 1/2*e)^7 + 15444*a^3*c*d^2*tan(1/2*f*x + 1/2*e)^7 + 4554*a^3*d^3*tan(1/2*f*x
 + 1/2*e)^7 - 9360*a^3*c^3*tan(1/2*f*x + 1/2*e)^5 - 22500*a^3*c^2*d*tan(1/2*f*x + 1/2*e)^5 - 17964*a^3*c*d^2*t
an(1/2*f*x + 1/2*e)^5 - 5814*a^3*d^3*tan(1/2*f*x + 1/2*e)^5 + 5560*a^3*c^3*tan(1/2*f*x + 1/2*e)^3 + 15390*a^3*
c^2*d*tan(1/2*f*x + 1/2*e)^3 + 12570*a^3*c*d^2*tan(1/2*f*x + 1/2*e)^3 + 3165*a^3*d^3*tan(1/2*f*x + 1/2*e)^3 -
1320*a^3*c^3*tan(1/2*f*x + 1/2*e) - 4410*a^3*c^2*d*tan(1/2*f*x + 1/2*e) - 4590*a^3*c*d^2*tan(1/2*f*x + 1/2*e)
- 1575*a^3*d^3*tan(1/2*f*x + 1/2*e))/(tan(1/2*f*x + 1/2*e)^2 - 1)^6)/f

Mupad [B] (verification not implemented)

Time = 17.05 (sec) , antiderivative size = 411, normalized size of antiderivative = 1.43 \[ \int \sec (e+f x) (a+a \sec (e+f x))^3 (c+d \sec (e+f x))^3 \, dx=\frac {a^3\,\mathrm {atanh}\left (\frac {\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (40\,c^3+90\,c^2\,d+78\,c\,d^2+23\,d^3\right )}{4\,\left (10\,c^3+\frac {45\,c^2\,d}{2}+\frac {39\,c\,d^2}{2}+\frac {23\,d^3}{4}\right )}\right )\,\left (40\,c^3+90\,c^2\,d+78\,c\,d^2+23\,d^3\right )}{8\,f}-\frac {\left (5\,a^3\,c^3+\frac {45\,a^3\,c^2\,d}{4}+\frac {39\,a^3\,c\,d^2}{4}+\frac {23\,a^3\,d^3}{8}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^{11}+\left (-\frac {85\,a^3\,c^3}{3}-\frac {255\,a^3\,c^2\,d}{4}-\frac {221\,a^3\,c\,d^2}{4}-\frac {391\,a^3\,d^3}{24}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^9+\left (66\,a^3\,c^3+\frac {297\,a^3\,c^2\,d}{2}+\frac {1287\,a^3\,c\,d^2}{10}+\frac {759\,a^3\,d^3}{20}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^7+\left (-78\,a^3\,c^3-\frac {375\,a^3\,c^2\,d}{2}-\frac {1497\,a^3\,c\,d^2}{10}-\frac {969\,a^3\,d^3}{20}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5+\left (\frac {139\,a^3\,c^3}{3}+\frac {513\,a^3\,c^2\,d}{4}+\frac {419\,a^3\,c\,d^2}{4}+\frac {211\,a^3\,d^3}{8}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3+\left (-11\,a^3\,c^3-\frac {147\,a^3\,c^2\,d}{4}-\frac {153\,a^3\,c\,d^2}{4}-\frac {105\,a^3\,d^3}{8}\right )\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^{12}-6\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^{10}+15\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^8-20\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6+15\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4-6\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+1\right )} \]

[In]

int(((a + a/cos(e + f*x))^3*(c + d/cos(e + f*x))^3)/cos(e + f*x),x)

[Out]

(a^3*atanh((tan(e/2 + (f*x)/2)*(78*c*d^2 + 90*c^2*d + 40*c^3 + 23*d^3))/(4*((39*c*d^2)/2 + (45*c^2*d)/2 + 10*c
^3 + (23*d^3)/4)))*(78*c*d^2 + 90*c^2*d + 40*c^3 + 23*d^3))/(8*f) - (tan(e/2 + (f*x)/2)^11*(5*a^3*c^3 + (23*a^
3*d^3)/8 + (39*a^3*c*d^2)/4 + (45*a^3*c^2*d)/4) - tan(e/2 + (f*x)/2)^9*((85*a^3*c^3)/3 + (391*a^3*d^3)/24 + (2
21*a^3*c*d^2)/4 + (255*a^3*c^2*d)/4) + tan(e/2 + (f*x)/2)^3*((139*a^3*c^3)/3 + (211*a^3*d^3)/8 + (419*a^3*c*d^
2)/4 + (513*a^3*c^2*d)/4) + tan(e/2 + (f*x)/2)^7*(66*a^3*c^3 + (759*a^3*d^3)/20 + (1287*a^3*c*d^2)/10 + (297*a
^3*c^2*d)/2) - tan(e/2 + (f*x)/2)^5*(78*a^3*c^3 + (969*a^3*d^3)/20 + (1497*a^3*c*d^2)/10 + (375*a^3*c^2*d)/2)
- tan(e/2 + (f*x)/2)*(11*a^3*c^3 + (105*a^3*d^3)/8 + (153*a^3*c*d^2)/4 + (147*a^3*c^2*d)/4))/(f*(15*tan(e/2 +
(f*x)/2)^4 - 6*tan(e/2 + (f*x)/2)^2 - 20*tan(e/2 + (f*x)/2)^6 + 15*tan(e/2 + (f*x)/2)^8 - 6*tan(e/2 + (f*x)/2)
^10 + tan(e/2 + (f*x)/2)^12 + 1))